package com.tmt.im.common.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tmt.im.common.annotation._AllowUpdate;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

import java.io.Serial;
import java.sql.Timestamp;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/3 23:02
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class WalletChangeDetailPoJo implements IGetKey<Long> {

    @Serial
    private static final long serialVersionUID = 6049018036484138730L;

    public static final String CACHE_NAME = "wallet_change_detail";

    @QuerySqlField(name = "id", index = true)
    private Long id;

    /**
     * 事件ID。
     * 当action为各类红包发送事件或退款事件时，eventId填充的是红包记录的ID。
     * 当action为领取红包事件时，eventId填充的是红包详情记录的ID。
     */
    @QuerySqlField(name = "event_id")
    private Long eventId;

    /**
     * 钱包事件类型
     */
    @QuerySqlField(name = "event_type")
    private String eventType;

    @QuerySqlField(name = "amount")
    private Long amount;

    @QuerySqlField(name = "balance")
    private Long balance;

    @QuerySqlField(name = "balance")
    private String note;

    @QuerySqlField(name = "wallet_id")
    private Long walletId;

    @QuerySqlField(name = "create_time")
    private Timestamp createTime;

    @QuerySqlField(name = "creator_id")
    private Long creatorId;

    @QuerySqlField(name = "version")
    private Long version;

    @JsonIgnore
    private boolean insert;

    @Override
    public Long getKey() {
        return id;
    }
}
